/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package clientereligadora.paineis;

import clientereligadora.conexao.Conexao;
import clientereligadora.entidades.Configuracao;
import clientereligadora.operacoes.Operacao;
import com.mysql.jdbc.ResultSet;
import com.mysql.jdbc.Statement;
import java.awt.Cursor;
import java.awt.Image;
import java.awt.event.KeyEvent;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.text.Normalizer;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;

/**
 *
 * @author leandro.aquino
 */
public final class PainelConfiguracao extends javax.swing.JPanel {

    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss.SS");
    SimpleDateFormat sdf1 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss.SS");
    SimpleDateFormat dateFormatDB = new SimpleDateFormat("yyyy-MM-dd");
    DecimalFormat fmt = new DecimalFormat("0.00");
    Operacao operacao = new Operacao();
    Image im = new ImageIcon(getClass().getResource("/imagens/fundo.jpg")).getImage();
    ResultSet rs;
    Statement stmt;
    int idReligadora = 5;
    public static  boolean click = false;
      public static  int numclic = 1;

    /**
     * Creates new form PainelChart
     */
    public PainelConfiguracao() {

        initComponents();
        //verifica se tem id cadastrado na tabela
        consultaIdReligadora();
        //define quantidade de caracteres inteiros para os textfields
        setParametroInteiro();
        //desabilita para edicao
        desabilitaCampos();
        


    }

    public void consultaIdReligadora() {
        String command = "SELECT *  FROM dataserverreligadora.configuracao ";

        try {
            stmt = (Statement) Conexao.conn.createStatement();

            rs = (ResultSet) stmt.executeQuery(command);
            //grava fields
        } catch (SQLException e) {
            System.out.println(e);
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        painel = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        txt_ncsot = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        txt_ncsut = new javax.swing.JTextField();
        txt_id = new javax.swing.JTextField();
        txt_idReligadora = new javax.swing.JTextField();
        txt_opmode = new javax.swing.JTextField();
        txt_ka = new javax.swing.JTextField();
        txt_lalsoc = new javax.swing.JTextField();
        txt_ptrafo = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        txt_cserv = new javax.swing.JTextField();
        txt_is = new javax.swing.JTextField();
        txt_cneutromax = new javax.swing.JTextField();
        txt_ncsc = new javax.swing.JTextField();
        txt_cmax = new javax.swing.JTextField();
        txt_cneutro = new javax.swing.JTextField();
        txt_ccurto = new javax.swing.JTextField();
        txt_icc = new javax.swing.JTextField();
        txt_mca = new javax.swing.JTextField();
        jLabel48 = new javax.swing.JLabel();
        jLabel49 = new javax.swing.JLabel();
        jLabel50 = new javax.swing.JLabel();
        jLabel51 = new javax.swing.JLabel();
        txt_subtensaorearme = new javax.swing.JTextField();
        txt_correnteaviso = new javax.swing.JTextField();
        txt_sobretensaoaviso = new javax.swing.JTextField();
        txt_subtensaoaviso = new javax.swing.JTextField();
        txt_subtensaodesarme = new javax.swing.JTextField();
        txt_lacsoc = new javax.swing.JTextField();
        txt_carrenterearme = new javax.swing.JTextField();
        txt_pacpot = new javax.swing.JTextField();
        txt_sobretensaorearme = new javax.swing.JTextField();
        jLabel52 = new javax.swing.JLabel();
        txt_correntedesarme = new javax.swing.JTextField();
        jLabel53 = new javax.swing.JLabel();
        jLabel54 = new javax.swing.JLabel();
        jLabel55 = new javax.swing.JLabel();
        jLabel56 = new javax.swing.JLabel();
        jLabel57 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        jLabel59 = new javax.swing.JLabel();
        txt_sobretensaodesarme = new javax.swing.JTextField();
        jLabel60 = new javax.swing.JLabel();
        jLabel61 = new javax.swing.JLabel();
        jLabel62 = new javax.swing.JLabel();
        jLabel63 = new javax.swing.JLabel();
        jLabel64 = new javax.swing.JLabel();
        txt_NreligamentoCorrente = new javax.swing.JTextField();
        txt_sobrecargadesarme = new javax.swing.JTextField();
        txt_TReligamentoNorTens = new javax.swing.JTextField();
        txt_correntenDesarme = new javax.swing.JTextField();
        txt_correntenRearme = new javax.swing.JTextField();
        jLabel65 = new javax.swing.JLabel();
        jLabel66 = new javax.swing.JLabel();
        txt_faltafasedesarme = new javax.swing.JTextField();
        txt_faltafaseaviso = new javax.swing.JTextField();
        jLabel67 = new javax.swing.JLabel();
        jLabel68 = new javax.swing.JLabel();
        txt_inrush = new javax.swing.JTextField();
        jLabel69 = new javax.swing.JLabel();
        jLabel70 = new javax.swing.JLabel();
        txt_faltafaserearme = new javax.swing.JTextField();
        jLabel71 = new javax.swing.JLabel();
        txt_sobrecargaaviso = new javax.swing.JTextField();
        txt_correntenAviso = new javax.swing.JTextField();
        jLabel72 = new javax.swing.JLabel();
        txt_vmax = new javax.swing.JTextField();
        jLabel73 = new javax.swing.JLabel();
        txt_sobrecargarearme = new javax.swing.JTextField();
        jLabel74 = new javax.swing.JLabel();
        jLabel75 = new javax.swing.JLabel();
        jLabel76 = new javax.swing.JLabel();
        jLabel77 = new javax.swing.JLabel();
        jLabel79 = new javax.swing.JLabel();
        jSeparator5 = new javax.swing.JSeparator();
        txt_limiteSubTensao = new javax.swing.JTextField();
        txt_limitesobretensao = new javax.swing.JTextField();
        txt_status = new javax.swing.JTextField();
        jLabel88 = new javax.swing.JLabel();
        jLabel78 = new javax.swing.JLabel();
        txt_intervalo1 = new javax.swing.JTextField();
        jLabel80 = new javax.swing.JLabel();
        txt_intervalo2 = new javax.swing.JTextField();
        jLabel81 = new javax.swing.JLabel();
        txt_intervalo3 = new javax.swing.JTextField();
        jLabel82 = new javax.swing.JLabel();
        txt_intervalo4 = new javax.swing.JTextField();
        jLabel83 = new javax.swing.JLabel();
        txt_intervalo5 = new javax.swing.JTextField();
        jLabel84 = new javax.swing.JLabel();
        txt_TLatenciaReligamento = new javax.swing.JTextField();
        txt_intMed = new javax.swing.JTextField();
        jLabel85 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        txt_data = new com.toedter.calendar.JDateChooser();

        setBackground(new java.awt.Color(255, 255, 255));
        setPreferredSize(new java.awt.Dimension(772, 489));

        painel.setBackground(new java.awt.Color(255, 255, 255));
        painel.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel8.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel8.setForeground(new java.awt.Color(0, 0, 109));
        jLabel8.setText("_is:");

        jLabel9.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel9.setForeground(new java.awt.Color(0, 0, 109));
        jLabel9.setText("Cserv:");

        jLabel6.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel6.setForeground(new java.awt.Color(0, 0, 109));
        jLabel6.setText("Mca:");

        jLabel7.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(0, 0, 109));
        jLabel7.setText("Icc:");

        jLabel12.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel12.setForeground(new java.awt.Color(0, 0, 109));
        jLabel12.setText("ncsc:");

        jLabel10.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel10.setForeground(new java.awt.Color(0, 0, 109));
        jLabel10.setText("Cmax:");

        jLabel11.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel11.setForeground(new java.awt.Color(0, 0, 109));
        jLabel11.setText("Ccurto:");

        txt_ncsot.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_ncsot.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_ncsotKeyPressed(evt);
            }
        });

        jLabel15.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel15.setForeground(new java.awt.Color(0, 0, 109));
        jLabel15.setText("Ncsut:");

        jLabel14.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel14.setForeground(new java.awt.Color(0, 0, 109));
        jLabel14.setText("CneutroMax:");

        jLabel13.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel13.setForeground(new java.awt.Color(0, 0, 109));
        jLabel13.setText("Cneutro:");

        jLabel29.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel29.setForeground(new java.awt.Color(0, 0, 109));
        jLabel29.setText("Lalsoc:");

        jLabel28.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel28.setForeground(new java.awt.Color(0, 0, 109));
        jLabel28.setText("Ptrafo:");

        jLabel1.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(0, 0, 109));
        jLabel1.setText("ID:");

        jLabel3.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel3.setForeground(new java.awt.Color(0, 0, 109));
        jLabel3.setText("ID Religadora:");

        jLabel5.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel5.setForeground(new java.awt.Color(0, 0, 109));
        jLabel5.setText("Ka");

        jLabel4.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(0, 0, 109));
        jLabel4.setText("Modo de Operacao:");

        txt_ncsut.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_ncsut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txt_ncsutActionPerformed(evt);
            }
        });
        txt_ncsut.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_ncsutKeyPressed(evt);
            }
        });

        txt_id.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_id.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_idKeyPressed(evt);
            }
        });

        txt_idReligadora.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_idReligadora.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_idReligadoraKeyPressed(evt);
            }
        });

        txt_opmode.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_opmode.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_opmodeKeyPressed(evt);
            }
        });

        txt_ka.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_ka.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_kaKeyPressed(evt);
            }
        });

        txt_lalsoc.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_lalsoc.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_lalsocKeyPressed(evt);
            }
        });

        txt_ptrafo.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_ptrafo.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_ptrafoKeyPressed(evt);
            }
        });

        jLabel16.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel16.setForeground(new java.awt.Color(0, 0, 109));
        jLabel16.setText("Ncsot:");

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);

        txt_cserv.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_cserv.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_cservKeyPressed(evt);
            }
        });

        txt_is.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_is.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_isKeyPressed(evt);
            }
        });

        txt_cneutromax.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_cneutromax.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_cneutromaxKeyPressed(evt);
            }
        });

        txt_ncsc.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_ncsc.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_ncscKeyPressed(evt);
            }
        });

        txt_cmax.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_cmax.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_cmaxKeyPressed(evt);
            }
        });

        txt_cneutro.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_cneutro.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_cneutroKeyPressed(evt);
            }
        });

        txt_ccurto.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_ccurto.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_ccurtoKeyPressed(evt);
            }
        });

        txt_icc.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_icc.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_iccKeyPressed(evt);
            }
        });

        txt_mca.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_mca.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_mcaKeyPressed(evt);
            }
        });

        jLabel48.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/2-1.png"))); // NOI18N
        jLabel48.setText("jLabel48");
        jLabel48.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel48MouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabel48MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabel48MouseExited(evt);
            }
        });

        jLabel49.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/3-1.png"))); // NOI18N
        jLabel49.setText("jLabel48");
        jLabel49.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel49MouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabel49MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabel49MouseExited(evt);
            }
        });

        jLabel50.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/1-1.png"))); // NOI18N
        jLabel50.setText("jLabel48");
        jLabel50.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel50MouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabel50MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabel50MouseExited(evt);
            }
        });

        jLabel51.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/4-1.png"))); // NOI18N
        jLabel51.setText("jLabel48");
        jLabel51.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLabel51MouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jLabel51MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jLabel51MouseExited(evt);
            }
        });

        txt_subtensaorearme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_subtensaorearme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_subtensaorearmeKeyPressed(evt);
            }
        });

        txt_correnteaviso.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_correnteaviso.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_correnteavisoKeyPressed(evt);
            }
        });

        txt_sobretensaoaviso.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_sobretensaoaviso.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_sobretensaoavisoKeyPressed(evt);
            }
        });

        txt_subtensaoaviso.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_subtensaoaviso.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_subtensaoavisoKeyPressed(evt);
            }
        });

        txt_subtensaodesarme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_subtensaodesarme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_subtensaodesarmeKeyPressed(evt);
            }
        });

        txt_lacsoc.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_lacsoc.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_lacsocKeyPressed(evt);
            }
        });

        txt_carrenterearme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_carrenterearme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_carrenterearmeKeyPressed(evt);
            }
        });

        txt_pacpot.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_pacpot.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_pacpotKeyPressed(evt);
            }
        });

        txt_sobretensaorearme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_sobretensaorearme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_sobretensaorearmeKeyPressed(evt);
            }
        });

        jLabel52.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel52.setForeground(new java.awt.Color(0, 0, 109));
        jLabel52.setText("Sobre Tensao Rearme:");

        txt_correntedesarme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_correntedesarme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_correntedesarmeKeyPressed(evt);
            }
        });

        jLabel53.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel53.setForeground(new java.awt.Color(0, 0, 109));
        jLabel53.setText("Corrente aviso:");

        jLabel54.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel54.setForeground(new java.awt.Color(0, 0, 109));
        jLabel54.setText("Pacpot:");

        jLabel55.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel55.setForeground(new java.awt.Color(0, 0, 109));
        jLabel55.setText("Sobre Tensao Aviso:");

        jLabel56.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel56.setForeground(new java.awt.Color(0, 0, 109));
        jLabel56.setText("Corrente Rearme:");

        jLabel57.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel57.setForeground(new java.awt.Color(0, 0, 109));
        jLabel57.setText("Sub Tensao Aviso:");

        jLabel58.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel58.setForeground(new java.awt.Color(0, 0, 109));
        jLabel58.setText("Lacsoc:");

        jLabel59.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel59.setForeground(new java.awt.Color(0, 0, 109));
        jLabel59.setText("Corrente Desarme:");

        txt_sobretensaodesarme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_sobretensaodesarme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_sobretensaodesarmeKeyPressed(evt);
            }
        });

        jLabel60.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel60.setForeground(new java.awt.Color(0, 0, 109));
        jLabel60.setText("Sobre Tensao Desarme:");

        jLabel61.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel61.setForeground(new java.awt.Color(0, 0, 109));
        jLabel61.setText("Sub Tensao Rearme:");

        jLabel62.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel62.setForeground(new java.awt.Color(0, 0, 109));
        jLabel62.setText("Sub Tensao Desarme:");

        jLabel63.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel63.setForeground(new java.awt.Color(0, 0, 109));
        jLabel63.setText("Falta Fase Aviso:");

        jLabel64.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel64.setForeground(new java.awt.Color(0, 0, 109));
        jLabel64.setText("Falta Fase Desarme:");

        txt_NreligamentoCorrente.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_NreligamentoCorrente.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_NreligamentoCorrenteKeyPressed(evt);
            }
        });

        txt_sobrecargadesarme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_sobrecargadesarme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_sobrecargadesarmeKeyPressed(evt);
            }
        });

        txt_TReligamentoNorTens.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_TReligamentoNorTens.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_TReligamentoNorTensKeyPressed(evt);
            }
        });

        txt_correntenDesarme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_correntenDesarme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_correntenDesarmeKeyPressed(evt);
            }
        });

        txt_correntenRearme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_correntenRearme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_correntenRearmeKeyPressed(evt);
            }
        });

        jLabel65.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel65.setForeground(new java.awt.Color(0, 0, 109));
        jLabel65.setText("Corrente Neutro Desarme:");

        jLabel66.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel66.setForeground(new java.awt.Color(0, 0, 109));
        jLabel66.setText("Falta Fase Rearme:");

        txt_faltafasedesarme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_faltafasedesarme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_faltafasedesarmeKeyPressed(evt);
            }
        });

        txt_faltafaseaviso.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_faltafaseaviso.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_faltafaseavisoKeyPressed(evt);
            }
        });

        jLabel67.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel67.setForeground(new java.awt.Color(0, 0, 109));
        jLabel67.setText("Nº Religamento Corrente:");

        jLabel68.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel68.setForeground(new java.awt.Color(0, 0, 109));
        jLabel68.setText("Inrush:");

        txt_inrush.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_inrush.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_inrushKeyPressed(evt);
            }
        });

        jLabel69.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel69.setForeground(new java.awt.Color(0, 0, 109));
        jLabel69.setText("Sobre Carga Rearme:");

        jLabel70.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel70.setForeground(new java.awt.Color(0, 0, 109));
        jLabel70.setText("Corrente Neutro Rearme:");

        txt_faltafaserearme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_faltafaserearme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_faltafaserearmeKeyPressed(evt);
            }
        });

        jLabel71.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel71.setForeground(new java.awt.Color(0, 0, 109));
        jLabel71.setText("Corrente Neutro Aviso:");

        txt_sobrecargaaviso.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_sobrecargaaviso.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_sobrecargaavisoKeyPressed(evt);
            }
        });

        txt_correntenAviso.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_correntenAviso.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_correntenAvisoKeyPressed(evt);
            }
        });

        jLabel72.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel72.setForeground(new java.awt.Color(0, 0, 109));
        jLabel72.setText("Vmax:");

        txt_vmax.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_vmax.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_vmaxKeyPressed(evt);
            }
        });

        jLabel73.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel73.setForeground(new java.awt.Color(0, 0, 109));
        jLabel73.setText("Sobre Carga Desarme:");

        txt_sobrecargarearme.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_sobrecargarearme.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_sobrecargarearmeKeyPressed(evt);
            }
        });

        jLabel74.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel74.setForeground(new java.awt.Color(0, 0, 109));
        jLabel74.setText("T. Religamento Nor Ten.");

        jLabel75.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel75.setForeground(new java.awt.Color(0, 0, 109));
        jLabel75.setText("Sobre Carga Aviso:");

        jLabel76.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel76.setForeground(new java.awt.Color(0, 0, 109));
        jLabel76.setText("Limite Sobre Tensao:");

        jLabel77.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel77.setForeground(new java.awt.Color(0, 0, 109));
        jLabel77.setText("Limite SubTensao:");

        jLabel79.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel79.setForeground(new java.awt.Color(0, 0, 109));
        jLabel79.setText("Int Status:");

        jSeparator5.setOrientation(javax.swing.SwingConstants.VERTICAL);

        txt_limiteSubTensao.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_limiteSubTensao.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_limiteSubTensaoKeyPressed(evt);
            }
        });

        txt_limitesobretensao.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_limitesobretensao.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_limitesobretensaoKeyPressed(evt);
            }
        });

        txt_status.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_status.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_statusKeyPressed(evt);
            }
        });

        jLabel88.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel88.setForeground(new java.awt.Color(0, 0, 109));
        jLabel88.setText("Data:");

        jLabel78.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel78.setForeground(new java.awt.Color(0, 0, 109));
        jLabel78.setText("Intervalo 1:");

        txt_intervalo1.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_intervalo1.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_intervalo1KeyPressed(evt);
            }
        });

        jLabel80.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel80.setForeground(new java.awt.Color(0, 0, 109));
        jLabel80.setText("Intervalo 2:");

        txt_intervalo2.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_intervalo2.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_intervalo2KeyPressed(evt);
            }
        });

        jLabel81.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel81.setForeground(new java.awt.Color(0, 0, 109));
        jLabel81.setText("Intervalo 3:");

        txt_intervalo3.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_intervalo3.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_intervalo3KeyPressed(evt);
            }
        });

        jLabel82.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel82.setForeground(new java.awt.Color(0, 0, 109));
        jLabel82.setText("Intervalo 4:");

        txt_intervalo4.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_intervalo4.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_intervalo4KeyPressed(evt);
            }
        });

        jLabel83.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel83.setForeground(new java.awt.Color(0, 0, 109));
        jLabel83.setText("Intervalo 5:");

        txt_intervalo5.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_intervalo5.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_intervalo5KeyPressed(evt);
            }
        });

        jLabel84.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel84.setForeground(new java.awt.Color(0, 0, 109));
        jLabel84.setText("T. Latencia Pos Religamento:");

        txt_TLatenciaReligamento.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_TLatenciaReligamento.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_TLatenciaReligamentoKeyPressed(evt);
            }
        });

        txt_intMed.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        txt_intMed.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                txt_intMedKeyPressed(evt);
            }
        });

        jLabel85.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
        jLabel85.setForeground(new java.awt.Color(0, 0, 109));
        jLabel85.setText("Int Med:");

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/27 -Add.png"))); // NOI18N
        jButton1.setToolTipText("Incluir");
        jButton1.setBorder(null);
        jButton1.setBorderPainted(false);
        jButton1.setContentAreaFilled(false);
        jButton1.setFocusPainted(false);
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButton1MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton1MouseExited(evt);
            }
        });
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/14_alterar.png"))); // NOI18N
        jButton3.setToolTipText("Alterar");
        jButton3.setBorder(null);
        jButton3.setBorderPainted(false);
        jButton3.setContentAreaFilled(false);
        jButton3.setFocusPainted(false);
        jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton3MouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButton3MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton3MouseExited(evt);
            }
        });
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/26 -delete.png"))); // NOI18N
        jButton4.setToolTipText("Remover");
        jButton4.setBorder(null);
        jButton4.setBorderPainted(false);
        jButton4.setContentAreaFilled(false);
        jButton4.setFocusPainted(false);
        jButton4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButton4MouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton4MouseExited(evt);
            }
        });
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);

        javax.swing.GroupLayout painelLayout = new javax.swing.GroupLayout(painel);
        painel.setLayout(painelLayout);
        painelLayout.setHorizontalGroup(
            painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelLayout.createSequentialGroup()
                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel15)
                                .addComponent(jLabel16)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txt_opmode, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(painelLayout.createSequentialGroup()
                                .addGap(1, 1, 1)
                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txt_icc, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txt_is, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txt_cserv, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txt_ccurto, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txt_cmax, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txt_cneutro, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txt_cneutromax, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txt_ncsc, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(txt_ka, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txt_ncsut, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txt_mca, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txt_ncsot, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(painelLayout.createSequentialGroup()
                                .addComponent(jButton1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButton4)
                                .addGap(191, 191, 191))
                            .addGroup(painelLayout.createSequentialGroup()
                                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, Short.MAX_VALUE)
                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel28)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_ptrafo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(painelLayout.createSequentialGroup()
                                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel54, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel53, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel59, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel56, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel57, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel62, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel61, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel55, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel60, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel52, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jLabel29)
                                                .addComponent(jLabel58)))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(txt_lalsoc, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txt_lacsoc, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(painelLayout.createSequentialGroup()
                                                .addGap(1, 1, 1)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(txt_pacpot, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(txt_correnteaviso, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(txt_correntedesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(txt_carrenterearme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(txt_subtensaoaviso, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(txt_subtensaodesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(txt_subtensaorearme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(txt_sobretensaoaviso, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(txt_sobretensaodesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(txt_sobretensaorearme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                                .addGap(18, 18, 18)
                                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, Short.MAX_VALUE)
                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(painelLayout.createSequentialGroup()
                                            .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel75, javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(jLabel73, javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(jLabel69, javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(jLabel71, javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(jLabel65, javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(jLabel70, javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jLabel64)
                                                        .addComponent(jLabel66)))
                                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jButton3)
                                                    .addComponent(jLabel67)))
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(txt_faltafasedesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(txt_faltafaserearme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGroup(painelLayout.createSequentialGroup()
                                                    .addGap(1, 1, 1)
                                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(txt_sobrecargaaviso, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(txt_sobrecargadesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(txt_sobrecargarearme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(txt_correntenAviso, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(txt_correntenDesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(txt_correntenRearme, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(txt_NreligamentoCorrente, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                            .addComponent(jLabel78)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(txt_intervalo1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel63)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_faltafaseaviso, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel80)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_intervalo2, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel81)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_intervalo3, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(18, 18, 18)
                                .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 4, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel77, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel79, javax.swing.GroupLayout.Alignment.TRAILING))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(txt_limiteSubTensao, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txt_status, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel82)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_intervalo4, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel83)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_intervalo5, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel68, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel72, javax.swing.GroupLayout.Alignment.TRAILING))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(txt_inrush, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txt_vmax, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel85)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_intMed, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel74)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_TReligamentoNorTens, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel76)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_limitesobretensao, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel84)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_TLatenciaReligamento, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                        .addComponent(jLabel88)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(txt_data, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(20, 20, 20))))
                    .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 515, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(painelLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txt_id, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txt_idReligadora, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(50, 50, 50)
                        .addComponent(jLabel49, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(28, 28, 28)
                        .addComponent(jLabel48, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(28, 28, 28)
                        .addComponent(jLabel50, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(28, 28, 28)
                        .addComponent(jLabel51, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );
        painelLayout.setVerticalGroup(
            painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txt_idReligadora, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel3))
                    .addGroup(painelLayout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(txt_id, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel51, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel50, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel48, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel49, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                            .addGap(20, 20, 20)
                            .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 390, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(painelLayout.createSequentialGroup()
                            .addGap(18, 18, 18)
                            .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(painelLayout.createSequentialGroup()
                                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(painelLayout.createSequentialGroup()
                                                .addGap(1, 1, 1)
                                                .addComponent(jLabel4))
                                            .addGroup(painelLayout.createSequentialGroup()
                                                .addComponent(txt_opmode, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel5)
                                                    .addComponent(txt_ka, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel6)
                                                    .addComponent(txt_mca, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_icc, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel7))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_is, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel8))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_cserv, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel9))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_ccurto, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel11))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_cmax, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel10))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_cneutro, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel13))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_cneutromax, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel14))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_ncsc, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel12))))
                                        .addGap(18, 18, 18)
                                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel16)
                                            .addComponent(txt_ncsot, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel15)
                                            .addComponent(txt_ncsut, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(painelLayout.createSequentialGroup()
                                        .addGap(2, 2, 2)
                                        .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(painelLayout.createSequentialGroup()
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel28)
                                                    .addComponent(txt_ptrafo, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel29)
                                                    .addComponent(txt_lalsoc, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_lacsoc, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel58))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_pacpot, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel54))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_correnteaviso, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel53))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_correntedesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel59))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_carrenterearme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel56))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_subtensaoaviso, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel57))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_subtensaodesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel62))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_subtensaorearme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel61))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_sobretensaoaviso, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel55))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_sobretensaodesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel60))
                                                .addGap(15, 15, 15)
                                                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(txt_sobretensaorearme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel52)))
                                            .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 390, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel63)
                                        .addComponent(txt_faltafaseaviso, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel64)
                                        .addComponent(txt_faltafasedesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_faltafaserearme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel66))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_sobrecargaaviso, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel75))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_sobrecargadesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel73))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_sobrecargarearme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel69))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_correntenAviso, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel71))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_correntenDesarme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel65))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_correntenRearme, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel70))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_NreligamentoCorrente, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel67))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_intervalo1, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel78))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_intervalo2, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel80))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_intervalo3, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel81)))
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_intervalo4, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel82))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_intervalo5, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel83))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_TLatenciaReligamento, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel84))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_TReligamentoNorTens, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel74))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_inrush, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel68))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_vmax, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel72))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel76)
                                        .addComponent(txt_limitesobretensao, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel77)
                                        .addComponent(txt_limiteSubTensao, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_status, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel79))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txt_intMed, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel85))
                                    .addGap(15, 15, 15)
                                    .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jLabel88)
                                        .addComponent(txt_data, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(51, 51, 51)))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, 388, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(painelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton4)
                    .addComponent(jButton3)
                    .addComponent(jButton1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(painel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(painel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void txt_ncsotKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_ncsotKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }  // TODO add your handling code here:
    }//GEN-LAST:event_txt_ncsotKeyPressed

    private void txt_ncsutKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_ncsutKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }  // TODO add your handling code here:
    }//GEN-LAST:event_txt_ncsutKeyPressed

    private void txt_idKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_idKeyPressed
    }//GEN-LAST:event_txt_idKeyPressed

    private void txt_idReligadoraKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_idReligadoraKeyPressed

        int key = evt.getKeyCode();

        if (key == KeyEvent.VK_ENTER) {
            //            idReligadora = Integer.parseInt(txt_idReligadora.getText());
            //            getGadosReligadora(idReligadora);
        }
    }//GEN-LAST:event_txt_idReligadoraKeyPressed

    private void txt_opmodeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_opmodeKeyPressed

        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
            // considerarEnterComoTab(txt_opmode);
        }
    }//GEN-LAST:event_txt_opmodeKeyPressed

    private void txt_kaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_kaKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
            //  considerarEnterComoTab(txt_mmode);
        }        // TODO add your handling code here:
    }//GEN-LAST:event_txt_kaKeyPressed

    private void txt_lalsocKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_lalsocKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }    // TODO add your handling code here:
    }//GEN-LAST:event_txt_lalsocKeyPressed

    private void txt_ptrafoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_ptrafoKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }  // TODO add your handling code here:
    }//GEN-LAST:event_txt_ptrafoKeyPressed

    private void txt_cservKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_cservKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }        // TODO add your handling code here:
    }//GEN-LAST:event_txt_cservKeyPressed

    private void txt_isKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_isKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }        // TODO add your handling code here:
    }//GEN-LAST:event_txt_isKeyPressed

    private void txt_cneutromaxKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_cneutromaxKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }        // TODO add your handling code here:
    }//GEN-LAST:event_txt_cneutromaxKeyPressed

    private void txt_ncscKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_ncscKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }        // TODO add your handling code here:
    }//GEN-LAST:event_txt_ncscKeyPressed

    private void txt_cmaxKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_cmaxKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }        // TODO add your handling code here:
    }//GEN-LAST:event_txt_cmaxKeyPressed

    private void txt_cneutroKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_cneutroKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }        // TODO add your handling code here:
    }//GEN-LAST:event_txt_cneutroKeyPressed

    private void txt_ccurtoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_ccurtoKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }        // TODO add your handling code here:
    }//GEN-LAST:event_txt_ccurtoKeyPressed

    private void txt_iccKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_iccKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }        // TODO add your handling code here:
    }//GEN-LAST:event_txt_iccKeyPressed

    private void txt_mcaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_mcaKeyPressed
        int key = evt.getKeyCode();
        if (key == KeyEvent.VK_ENTER) {
        }        // TODO add your handling code here:
    }//GEN-LAST:event_txt_mcaKeyPressed

    private void jLabel48MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel48MouseClicked
        anteriorRegistro();

        //        int id = 1;
        //        Configuracao cfg = operacao.getConfiguracao(id);
        //        txt_id.setText(""+cfg.getId());
        //        txt_idReligadora.setText(""+cfg.getId_religadora());
        //         Date data = cfg.getDatetime();
        //
        //       // System.out.println(cfg.getDatetime("data")+" - "+rs.getTime("data"));
        //
        //
        ////        Date data = new Date(System.currentTimeMillis());
        ////
        //        SimpleDateFormat formatarDate = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
        //         System.out.print("data: "+formatarDate.format(data));

        //        //operacao.getConfiguracao(null);

    }//GEN-LAST:event_jLabel48MouseClicked

    private void jLabel48MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel48MouseEntered
        setCursor(new Cursor(Cursor.HAND_CURSOR));
    }//GEN-LAST:event_jLabel48MouseEntered

    private void jLabel48MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel48MouseExited
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));         // TODO add your handling code here:
    }//GEN-LAST:event_jLabel48MouseExited

    private void jLabel49MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel49MouseClicked
        //desabilitaCampos();
        primeiroRegistro();
        //   jButton2.setText("EDITAR");
    }//GEN-LAST:event_jLabel49MouseClicked

    private void jLabel49MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel49MouseEntered
        setCursor(new Cursor(Cursor.HAND_CURSOR));        // TODO add your handling code here:
    }//GEN-LAST:event_jLabel49MouseEntered

    private void jLabel49MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel49MouseExited
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));        // TODO add your handling code here:
    }//GEN-LAST:event_jLabel49MouseExited

    private void jLabel50MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel50MouseClicked
        //        desabilitaCampos();
        proximoRegistro();
        //        jButton2.setText("EDITAR");
    }//GEN-LAST:event_jLabel50MouseClicked

    private void jLabel50MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel50MouseEntered
        setCursor(new Cursor(Cursor.HAND_CURSOR));        // TODO add your handling code here:
    }//GEN-LAST:event_jLabel50MouseEntered

    private void jLabel50MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel50MouseExited
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));         // TODO add your handling code here:
    }//GEN-LAST:event_jLabel50MouseExited

    private void jLabel51MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel51MouseClicked
        //        desabilitaCampos();
        ultimoRegistro();
        //        jButton2.setText("EDITAR");
    }//GEN-LAST:event_jLabel51MouseClicked

    private void jLabel51MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel51MouseEntered
        setCursor(new Cursor(Cursor.HAND_CURSOR));        // TODO add your handling code here:
    }//GEN-LAST:event_jLabel51MouseEntered

    private void jLabel51MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel51MouseExited
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));         // TODO add your handling code here:
    }//GEN-LAST:event_jLabel51MouseExited

    private void txt_subtensaorearmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_subtensaorearmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_subtensaorearmeKeyPressed

    private void txt_correnteavisoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_correnteavisoKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_correnteavisoKeyPressed

    private void txt_sobretensaoavisoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_sobretensaoavisoKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_sobretensaoavisoKeyPressed

    private void txt_subtensaoavisoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_subtensaoavisoKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_subtensaoavisoKeyPressed

    private void txt_subtensaodesarmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_subtensaodesarmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_subtensaodesarmeKeyPressed

    private void txt_lacsocKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_lacsocKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_lacsocKeyPressed

    private void txt_carrenterearmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_carrenterearmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_carrenterearmeKeyPressed

    private void txt_pacpotKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_pacpotKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_pacpotKeyPressed

    private void txt_sobretensaorearmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_sobretensaorearmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_sobretensaorearmeKeyPressed

    private void txt_correntedesarmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_correntedesarmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_correntedesarmeKeyPressed

    private void txt_sobretensaodesarmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_sobretensaodesarmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_sobretensaodesarmeKeyPressed

    private void txt_NreligamentoCorrenteKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_NreligamentoCorrenteKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_NreligamentoCorrenteKeyPressed

    private void txt_sobrecargadesarmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_sobrecargadesarmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_sobrecargadesarmeKeyPressed

    private void txt_TReligamentoNorTensKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_TReligamentoNorTensKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_TReligamentoNorTensKeyPressed

    private void txt_correntenDesarmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_correntenDesarmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_correntenDesarmeKeyPressed

    private void txt_correntenRearmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_correntenRearmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_correntenRearmeKeyPressed

    private void txt_faltafasedesarmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_faltafasedesarmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_faltafasedesarmeKeyPressed

    private void txt_faltafaseavisoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_faltafaseavisoKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_faltafaseavisoKeyPressed

    private void txt_inrushKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_inrushKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_inrushKeyPressed

    private void txt_faltafaserearmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_faltafaserearmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_faltafaserearmeKeyPressed

    private void txt_sobrecargaavisoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_sobrecargaavisoKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_sobrecargaavisoKeyPressed

    private void txt_correntenAvisoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_correntenAvisoKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_correntenAvisoKeyPressed

    private void txt_vmaxKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_vmaxKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_vmaxKeyPressed

    private void txt_sobrecargarearmeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_sobrecargarearmeKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_sobrecargarearmeKeyPressed

    private void txt_limiteSubTensaoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_limiteSubTensaoKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_limiteSubTensaoKeyPressed

    private void txt_limitesobretensaoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_limitesobretensaoKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_limitesobretensaoKeyPressed

    private void txt_statusKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_statusKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_statusKeyPressed

    private void txt_intervalo1KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_intervalo1KeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_intervalo1KeyPressed

    private void txt_intervalo2KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_intervalo2KeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_intervalo2KeyPressed

    private void txt_intervalo3KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_intervalo3KeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_intervalo3KeyPressed

    private void txt_intervalo4KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_intervalo4KeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_intervalo4KeyPressed

    private void txt_intervalo5KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_intervalo5KeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_intervalo5KeyPressed

    private void txt_TLatenciaReligamentoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_TLatenciaReligamentoKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_TLatenciaReligamentoKeyPressed

    private void txt_intMedKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txt_intMedKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_intMedKeyPressed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed

        if (verificaCamposNulos() == true) {
        } else {

            if (click == true) {
                int opt = JOptionPane.showConfirmDialog(null, "CONFIRMA ATUALIZAÇÃO '" + txt_id.getText() + "' \n DA RELIGADORA '" + txt_idReligadora.getText() + "'",
                        "CONFIRMA ATUALIZAÇÃO", JOptionPane.YES_NO_OPTION);

                if (opt == JOptionPane.YES_OPTION) {
                    try {
                        Thread.sleep(1000);
                        atualizarConfiguracao();

                    } catch (InterruptedException ex) {
                    } catch (ParseException ex) {
                        Logger.getLogger(PainelConfiguracao.class.getName()).log(Level.SEVERE, null, ex);
                    }

                } else {
                }


            } else {
            }


        }
         
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        try {
            inserirConfiguracao();
            desabilitaCampos();
        } catch (ParseException ex) {
            Logger.getLogger(PainelConfiguracao.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
    
            removeConfiguracao();
            desabilitaCampos();
       
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton4MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseEntered
   setCursor(new Cursor(Cursor.HAND_CURSOR));
    }//GEN-LAST:event_jButton4MouseEntered

    private void jButton4MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseExited
   setCursor(new Cursor(Cursor.DEFAULT_CURSOR));        // TODO add your handling code here:
    }//GEN-LAST:event_jButton4MouseExited

    private void jButton3MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseEntered
         setCursor(new Cursor(Cursor.HAND_CURSOR));
    }//GEN-LAST:event_jButton3MouseEntered

    private void jButton3MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseExited
     setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); 
    }//GEN-LAST:event_jButton3MouseExited

    private void jButton1MouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseEntered
        setCursor(new Cursor(Cursor.HAND_CURSOR));
    }//GEN-LAST:event_jButton1MouseEntered

    private void jButton1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseExited
     setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); 
    }//GEN-LAST:event_jButton1MouseExited

    private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked
       
     
       numclic++;
       
        System.out.println(numclic);
        if (numclic % 2 == 0) {
        click= true;
            System.out.println("par");
        }else{
            System.out.println("impar");
          click= false;  
        }
       
        
        if (click == true) {
             hablitaCampos();
            jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/23 -aply.png"))); // NOI18N

        } else {
            desabilitaCampos();
            jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/14_alterar.png"))); // NOI18N
        }

    }//GEN-LAST:event_jButton3MouseClicked

    private void txt_ncsutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txt_ncsutActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txt_ncsutActionPerformed
   
    public void removeConfiguracao(){
//         Configuracao cfg = new Configuracao();
//
//        cfg.setId(Integer.parseInt(txt_id.getText()));
          int opt = JOptionPane.showConfirmDialog(null, "DESEJA EXCLUIR CONFIGURAÇÃO '"+txt_id.getText()+"' \n DA RELIGADORA '"+txt_idReligadora.getText()+"'",
                "CONFIRMA EXCLUSÃO", JOptionPane.YES_NO_OPTION);
        if (opt == JOptionPane.YES_OPTION) {
            try {
                Thread.sleep(1000);
                   operacao.removeConfiguracao(Integer.parseInt(txt_id.getText()));
            } catch (InterruptedException ex) {
               
            }
           
        } else {
        }
     
    }
    public void atualizarConfiguracao() throws ParseException{
   
          click = false;
        Configuracao cfg = new Configuracao();
 try{
      cfg.setModo_operacao(Integer.parseInt(txt_opmode.getText()));
        cfg.setKa(Integer.parseInt(txt_ka.getText().replaceAll("[,.^]", ""))); 
        cfg.setMca(Integer.parseInt(txt_mca.getText().replaceAll("[,.^]", ""))); 
        cfg.setIcc(Integer.parseInt(txt_icc.getText().replaceAll("[,.^]", ""))); 
        cfg.setIs(Integer.parseInt(txt_is.getText().replaceAll("[,.^]", ""))); 
        cfg.setCserv(Integer.parseInt(txt_cserv.getText().replaceAll("[,.^]", ""))); 
        cfg.setCcurto(Integer.parseInt(txt_ccurto.getText().replaceAll("[,.^]", ""))); 
        cfg.setCmax(Integer.parseInt(txt_cmax.getText().replaceAll("[,.^]", ""))); 
        cfg.setCneutro(Integer.parseInt(txt_cneutro.getText().replaceAll("[,.^]", ""))); 
        cfg.setCneutromax(Integer.parseInt(txt_cneutromax.getText().replaceAll("[,.^]", ""))); 
        cfg.setNcsc(Integer.parseInt(txt_ncsc.getText().replaceAll("[,.^]", ""))); 
        cfg.setNcsot(Integer.parseInt(txt_ncsot.getText().replaceAll("[,.^]", ""))); 
        cfg.setNcsut(Integer.parseInt(txt_ncsut.getText().replaceAll("[,.^]", ""))); 
        cfg.setPtrafo(Integer.parseInt(txt_ptrafo.getText().replaceAll("[,.^]", ""))); 
        cfg.setLacsoc(Integer.parseInt(txt_lacsoc.getText().replaceAll("[,.^]", ""))); 
        cfg.setLalsoc(Integer.parseInt(txt_lalsoc.getText().replaceAll("[,.^]", ""))); 
        cfg.setPacpot(Integer.parseInt(txt_pacpot.getText().replaceAll("[,.^]", ""))); 
        cfg.setCorrente_rearme(Integer.parseInt(txt_carrenterearme.getText().replaceAll("[,.^]", ""))); 
        cfg.setCorrente_aviso(Integer.parseInt(txt_correnteaviso.getText().replaceAll("[,.^]", ""))); 
        cfg.setCorrente_desarme(Integer.parseInt(txt_correntedesarme.getText().replaceAll("[,.^]", ""))); 
        cfg.setSub_tensao_aviso(Integer.parseInt(txt_subtensaoaviso.getText().replaceAll("[,.^]", ""))); 
        cfg.setSub_tensao_desarme(Integer.parseInt(txt_subtensaodesarme.getText().replaceAll("[,.^]", ""))); 
        cfg.setSub_tensao_rearme(Integer.parseInt(txt_subtensaorearme.getText().replaceAll("[,.^]", ""))); 
        cfg.setSobre_tensao_aviso(Integer.parseInt(txt_sobretensaoaviso.getText().replaceAll("[,.^]", ""))); 
        cfg.setSobre_tensao_desarme(Integer.parseInt(txt_sobretensaodesarme.getText().replaceAll("[,.^]", ""))); 
        cfg.setSobre_tensao_rearme(Integer.parseInt(txt_sobretensaorearme.getText().replaceAll("[,.^]", ""))); 
        cfg.setFalta_fase_aviso(Integer.parseInt(txt_faltafaseaviso.getText().replaceAll("[,.^]", ""))); 
        cfg.setFalta_fase_desarme(Integer.parseInt(txt_faltafasedesarme.getText().replaceAll("[,.^]", ""))); 
        cfg.setFalta_fase_rearme(Integer.parseInt(txt_faltafaserearme.getText().replaceAll("[,.^]", ""))); 
        cfg.setSobrecarga_aviso(Integer.parseInt(txt_sobrecargaaviso.getText().replaceAll("[,.^]", ""))); 
        cfg.setSobrecarga_desarme(Integer.parseInt(txt_sobrecargadesarme.getText().replaceAll("[,.^]", ""))); 
        cfg.setSobrecarga_rearme(Integer.parseInt(txt_sobrecargarearme.getText().replaceAll("[,.^]", ""))); 
        cfg.setCorrente_neutro_aviso(Integer.parseInt(txt_correntenAviso.getText().replaceAll("[,.^]", ""))); 
        cfg.setCorrente_neutro_desarme(Integer.parseInt(txt_correntenDesarme.getText().replaceAll("[,.^]", ""))); 
        cfg.setCorrente_neutro_rearme(Integer.parseInt(txt_correntenRearme.getText().replaceAll("[,.^]", ""))); 
        cfg.setNumero_religamentos_corrente(Integer.parseInt(txt_NreligamentoCorrente.getText())); 
        cfg.setIntervalo_1(Integer.parseInt(txt_intervalo1.getText())); 
        cfg.setIntervalo_2(Integer.parseInt(txt_intervalo2.getText())); 
        cfg.setIntervalo_3(Integer.parseInt(txt_intervalo3.getText())); 
        cfg.setIntervalo_4(Integer.parseInt(txt_intervalo4.getText())); 
        cfg.setIntervalo_5(Integer.parseInt(txt_intervalo5.getText())); 
        cfg.setTempo_latencia_pos_religamento(Integer.parseInt(txt_TLatenciaReligamento.getText())); 
        cfg.setTempo_religamento_pos_normalizacao_tensao(Integer.parseInt(txt_TReligamentoNorTens.getText())); 
        cfg.setInrush(Integer.parseInt(txt_inrush.getText().replaceAll("[,.^]", ""))); 
        cfg.setVmax(Integer.parseInt(txt_vmax.getText().replaceAll("[,.^]", ""))); 
        cfg.setLimite_subtensao(Integer.parseInt(txt_limiteSubTensao.getText().replaceAll("[,.^]", ""))); 
        cfg.setLimite_sobre_tensao(Integer.parseInt(txt_limitesobretensao.getText().replaceAll("[,.^]", ""))); 
        cfg.setInt_status(Integer.parseInt(txt_status.getText())); 
        cfg.setInt_med(Integer.parseInt(txt_intMed.getText())); 
    
         Date data = txt_data.getDate();
        cfg.setDatetime(data);
        /// String   date =  dateFormatDB.format(data); 

        operacao.atualizaConfiguracao(cfg,Integer.parseInt(txt_idReligadora.getText()));

        } catch (NumberFormatException Ex) {
            JOptionPane.showMessageDialog(null, "FORMULARIO COM CAMPO VAZIO \n OU CARACTERE INVÁLIDO");
          
        }
       
        
   }
    public void inserirConfiguracao() throws ParseException {
        Configuracao cfg = new Configuracao();

        cfg.setId(Integer.parseInt(txt_id.getText()));
        cfg.setId_religadora(Integer.parseInt(txt_idReligadora.getText()));
        cfg.setModo_operacao(Integer.parseInt(txt_opmode.getText()));
        cfg.setKa(Integer.parseInt(txt_ka.getText()));
        cfg.setMca(Integer.parseInt(txt_mca.getText()));
        cfg.setIcc(Integer.parseInt(txt_icc.getText()));
        cfg.setIs(Integer.parseInt(txt_is.getText()));
        cfg.setCserv(Integer.parseInt(txt_cserv.getText()));
        cfg.setCcurto(Integer.parseInt(txt_ccurto.getText()));
        cfg.setCmax(Integer.parseInt(txt_cmax.getText()));
        cfg.setCneutro(Integer.parseInt(txt_cneutro.getText()));
        cfg.setCneutromax(Integer.parseInt(txt_cneutromax.getText()));
        cfg.setNcsc(Integer.parseInt(txt_ncsc.getText()));
        cfg.setNcsot(Integer.parseInt(txt_ncsot.getText()));
        cfg.setNcsut(Integer.parseInt(txt_ncsut.getText()));
        cfg.setPtrafo(Integer.parseInt(txt_ptrafo.getText()));
        cfg.setLacsoc(Integer.parseInt(txt_lacsoc.getText()));
        cfg.setLalsoc(Integer.parseInt(txt_lalsoc.getText()));
        cfg.setPacpot(Integer.parseInt(txt_pacpot.getText()));
        cfg.setCorrente_rearme(Integer.parseInt(txt_carrenterearme.getText()));
        cfg.setCorrente_aviso(Integer.parseInt(txt_correnteaviso.getText()));
        cfg.setCorrente_desarme(Integer.parseInt(txt_correntedesarme.getText()));
        cfg.setSub_tensao_aviso(Integer.parseInt(txt_subtensaoaviso.getText()));
        cfg.setSub_tensao_desarme(Integer.parseInt(txt_subtensaodesarme.getText()));
        cfg.setSub_tensao_rearme(Integer.parseInt(txt_subtensaorearme.getText()));
        cfg.setSobre_tensao_aviso(Integer.parseInt(txt_sobretensaoaviso.getText()));
        cfg.setSobre_tensao_desarme(Integer.parseInt(txt_sobretensaodesarme.getText()));
        cfg.setSobre_tensao_rearme(Integer.parseInt(txt_sobretensaorearme.getText()));
        cfg.setFalta_fase_aviso(Integer.parseInt(txt_faltafaseaviso.getText()));
        cfg.setFalta_fase_desarme(Integer.parseInt(txt_faltafasedesarme.getText()));
        cfg.setFalta_fase_rearme(Integer.parseInt(txt_faltafaserearme.getText()));
        cfg.setSobrecarga_aviso(Integer.parseInt(txt_sobrecargaaviso.getText()));
        cfg.setSobrecarga_desarme(Integer.parseInt(txt_sobrecargadesarme.getText()));
        cfg.setSobrecarga_rearme(Integer.parseInt(txt_sobrecargarearme.getText()));
        cfg.setCorrente_neutro_aviso(Integer.parseInt(txt_correntenAviso.getText()));
        cfg.setCorrente_neutro_desarme(Integer.parseInt(txt_correntenDesarme.getText()));
        cfg.setCorrente_neutro_rearme(Integer.parseInt(txt_correntenRearme.getText()));
        cfg.setNumero_religamentos_corrente(Integer.parseInt(txt_NreligamentoCorrente.getText()));
        cfg.setIntervalo_1(Integer.parseInt(txt_intervalo1.getText()));
        cfg.setIntervalo_2(Integer.parseInt(txt_intervalo2.getText()));
        cfg.setIntervalo_3(Integer.parseInt(txt_intervalo3.getText()));
        cfg.setIntervalo_4(Integer.parseInt(txt_intervalo4.getText()));
        cfg.setIntervalo_5(Integer.parseInt(txt_intervalo5.getText()));
        cfg.setTempo_latencia_pos_religamento(Integer.parseInt(txt_TLatenciaReligamento.getText()));
        cfg.setTempo_religamento_pos_normalizacao_tensao(Integer.parseInt(txt_TReligamentoNorTens.getText()));
        cfg.setInrush(Integer.parseInt(txt_inrush.getText()));
        cfg.setVmax(Integer.parseInt(txt_vmax.getText()));
        cfg.setLimite_subtensao(Integer.parseInt(txt_limiteSubTensao.getText()));
        cfg.setLimite_sobre_tensao(Integer.parseInt(txt_limitesobretensao.getText()));
        cfg.setInt_status(Integer.parseInt(txt_status.getText()));
        cfg.setInt_med(Integer.parseInt(txt_intMed.getText()));
    
        
        Date data = txt_data.getDate();
       /// String   date =  dateFormatDB.format(data); 
        cfg.setDatetime(data);
        operacao.inserirConfiguracao(cfg);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    public static javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    public static javax.swing.JLabel jLabel10;
    public static javax.swing.JLabel jLabel11;
    public static javax.swing.JLabel jLabel12;
    public static javax.swing.JLabel jLabel13;
    public static javax.swing.JLabel jLabel14;
    public static javax.swing.JLabel jLabel15;
    public static javax.swing.JLabel jLabel16;
    public static javax.swing.JLabel jLabel28;
    public static javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    public static javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    public static javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    public static javax.swing.JLabel jLabel52;
    public static javax.swing.JLabel jLabel53;
    public static javax.swing.JLabel jLabel54;
    public static javax.swing.JLabel jLabel55;
    public static javax.swing.JLabel jLabel56;
    public static javax.swing.JLabel jLabel57;
    public static javax.swing.JLabel jLabel58;
    public static javax.swing.JLabel jLabel59;
    public static javax.swing.JLabel jLabel6;
    public static javax.swing.JLabel jLabel60;
    public static javax.swing.JLabel jLabel61;
    public static javax.swing.JLabel jLabel62;
    public static javax.swing.JLabel jLabel63;
    public static javax.swing.JLabel jLabel64;
    public static javax.swing.JLabel jLabel65;
    public static javax.swing.JLabel jLabel66;
    public static javax.swing.JLabel jLabel67;
    public static javax.swing.JLabel jLabel68;
    public static javax.swing.JLabel jLabel69;
    public static javax.swing.JLabel jLabel7;
    public static javax.swing.JLabel jLabel70;
    public static javax.swing.JLabel jLabel71;
    public static javax.swing.JLabel jLabel72;
    public static javax.swing.JLabel jLabel73;
    public static javax.swing.JLabel jLabel74;
    public static javax.swing.JLabel jLabel75;
    public static javax.swing.JLabel jLabel76;
    public static javax.swing.JLabel jLabel77;
    public static javax.swing.JLabel jLabel78;
    public static javax.swing.JLabel jLabel79;
    public static javax.swing.JLabel jLabel8;
    public static javax.swing.JLabel jLabel80;
    public static javax.swing.JLabel jLabel81;
    public static javax.swing.JLabel jLabel82;
    public static javax.swing.JLabel jLabel83;
    public static javax.swing.JLabel jLabel84;
    public static javax.swing.JLabel jLabel85;
    public static javax.swing.JLabel jLabel88;
    public static javax.swing.JLabel jLabel9;
    public static javax.swing.JSeparator jSeparator1;
    public static javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    public static javax.swing.JSeparator jSeparator5;
    public static javax.swing.JPanel painel;
    public static javax.swing.JTextField txt_NreligamentoCorrente;
    public static javax.swing.JTextField txt_TLatenciaReligamento;
    public static javax.swing.JTextField txt_TReligamentoNorTens;
    public static javax.swing.JTextField txt_carrenterearme;
    public static javax.swing.JTextField txt_ccurto;
    public static javax.swing.JTextField txt_cmax;
    public static javax.swing.JTextField txt_cneutro;
    public static javax.swing.JTextField txt_cneutromax;
    public static javax.swing.JTextField txt_correnteaviso;
    public static javax.swing.JTextField txt_correntedesarme;
    public static javax.swing.JTextField txt_correntenAviso;
    public static javax.swing.JTextField txt_correntenDesarme;
    public static javax.swing.JTextField txt_correntenRearme;
    public static javax.swing.JTextField txt_cserv;
    public static com.toedter.calendar.JDateChooser txt_data;
    public static javax.swing.JTextField txt_faltafaseaviso;
    public static javax.swing.JTextField txt_faltafasedesarme;
    public static javax.swing.JTextField txt_faltafaserearme;
    public static javax.swing.JTextField txt_icc;
    public static javax.swing.JTextField txt_id;
    public static javax.swing.JTextField txt_idReligadora;
    public static javax.swing.JTextField txt_inrush;
    public static javax.swing.JTextField txt_intMed;
    public static javax.swing.JTextField txt_intervalo1;
    public static javax.swing.JTextField txt_intervalo2;
    public static javax.swing.JTextField txt_intervalo3;
    public static javax.swing.JTextField txt_intervalo4;
    public static javax.swing.JTextField txt_intervalo5;
    public static javax.swing.JTextField txt_is;
    public static javax.swing.JTextField txt_ka;
    public static javax.swing.JTextField txt_lacsoc;
    public static javax.swing.JTextField txt_lalsoc;
    public static javax.swing.JTextField txt_limiteSubTensao;
    public static javax.swing.JTextField txt_limitesobretensao;
    public static javax.swing.JTextField txt_mca;
    public static javax.swing.JTextField txt_ncsc;
    public static javax.swing.JTextField txt_ncsot;
    public static javax.swing.JTextField txt_ncsut;
    public static javax.swing.JTextField txt_opmode;
    public static javax.swing.JTextField txt_pacpot;
    public static javax.swing.JTextField txt_ptrafo;
    public static javax.swing.JTextField txt_sobrecargaaviso;
    public static javax.swing.JTextField txt_sobrecargadesarme;
    public static javax.swing.JTextField txt_sobrecargarearme;
    public static javax.swing.JTextField txt_sobretensaoaviso;
    public static javax.swing.JTextField txt_sobretensaodesarme;
    public static javax.swing.JTextField txt_sobretensaorearme;
    public static javax.swing.JTextField txt_status;
    public static javax.swing.JTextField txt_subtensaoaviso;
    public static javax.swing.JTextField txt_subtensaodesarme;
    public static javax.swing.JTextField txt_subtensaorearme;
    public static javax.swing.JTextField txt_vmax;
    // End of variables declaration//GEN-END:variables
    
    public static void zeraCampos() {                //METODO QUE CARREGA O ULTIMO REGISTRO DO BD  
     
            txt_id.setText("");
            txt_idReligadora.setText("");
            txt_opmode.setText("");
            txt_ka.setText("");
            txt_mca.setText("");
            txt_icc.setText("");
            txt_is.setText("");
            txt_cserv.setText("");
            txt_ccurto.setText("");
            txt_cmax.setText("");
            txt_cneutro.setText("");
            txt_cneutromax.setText("");
            txt_ncsc.setText("");
            txt_ncsot.setText("");
            txt_ncsut.setText("");
            txt_ptrafo.setText("");
            txt_lacsoc.setText("");
            txt_lalsoc.setText("");
            txt_pacpot.setText("");
            txt_carrenterearme.setText("");
            txt_correnteaviso.setText("");
            txt_correntedesarme.setText("");
            txt_subtensaoaviso.setText("");
            txt_subtensaodesarme.setText("");
            txt_subtensaorearme.setText("");
            txt_sobretensaoaviso.setText("");
            txt_sobretensaodesarme.setText("");
            txt_sobretensaorearme.setText("");
            txt_faltafaseaviso.setText("");
            txt_faltafasedesarme.setText("");
            txt_faltafaserearme.setText("");
            txt_sobrecargaaviso.setText("");
            txt_sobrecargadesarme.setText("");
            txt_sobrecargarearme.setText("");
            txt_correntenAviso.setText("");
            txt_correntenDesarme.setText("");
            txt_correntenRearme.setText("");
            txt_NreligamentoCorrente.setText("");
            txt_intervalo1.setText("");
            txt_intervalo2.setText("");
            txt_intervalo3.setText("");
            txt_intervalo4.setText("");
            txt_intervalo5.setText("");
            txt_TLatenciaReligamento.setText("");
            txt_TReligamentoNorTens.setText("");
            txt_inrush.setText("");
            txt_vmax.setText("");
            txt_limiteSubTensao.setText("");
            txt_limitesobretensao.setText("");
            txt_status.setText("");
            txt_intMed.setText("");
            Date data = new Date(System.currentTimeMillis());
            txt_data.setDate(data);


    }
    
    private void primeiroRegistro() {                //METODO QUE CARREGA O ULTIMO REGISTRO DO BD  
        try {

            rs.first();
            idReligadora = rs.getInt("id_religadora");

            Configuracao cfg = operacao.getConfiguracao(idReligadora);
            System.out.println(idReligadora);
            
            txt_id.setText(""+ cfg.getId());
            txt_idReligadora.setText(""+cfg.getId_religadora());
            txt_opmode.setText(""+cfg.getModo_operacao());
            txt_ka.setText(""+cfg.getKa());
            txt_mca.setText(""+ cfg.getMca());
            txt_icc.setText(""+ cfg.getIcc());
            txt_is.setText(""+ cfg.getIs());
            txt_cserv.setText(""+ cfg.getCserv());
            txt_ccurto.setText(""+cfg.getCcurto());
            txt_cmax.setText(""+cfg.getCmax());
            txt_cneutro.setText(""+cfg.getCneutro());
            txt_cneutromax.setText(""+cfg.getCneutromax());
            txt_ncsc.setText(""+cfg.getNcsc());
            txt_ncsot.setText(""+cfg.getNcsot());
            txt_ncsut.setText(""+cfg.getNcsut());
            txt_ptrafo.setText(""+cfg.getPtrafo());
            txt_lacsoc.setText(""+cfg.getLacsoc());
            txt_lalsoc.setText(""+cfg.getLalsoc());
            txt_pacpot.setText(""+cfg.getPacpot());
            txt_carrenterearme.setText(""+cfg.getCorrente_rearme());
            txt_correnteaviso.setText(""+cfg.getCorrente_aviso());
            txt_correntedesarme.setText(""+cfg.getCorrente_desarme());
            txt_subtensaoaviso.setText(""+cfg.getSub_tensao_aviso());
            txt_subtensaodesarme.setText(""+cfg.getSub_tensao_desarme());
            txt_subtensaorearme.setText(""+cfg.getSub_tensao_rearme());
            txt_sobretensaoaviso.setText(""+cfg.getSobre_tensao_aviso());
            txt_sobretensaodesarme.setText(""+cfg.getSobre_tensao_desarme());
            txt_sobretensaorearme.setText(""+cfg.getSobre_tensao_rearme());
            txt_faltafaseaviso.setText(""+cfg.getFalta_fase_aviso());
            txt_faltafasedesarme.setText(""+cfg.getFalta_fase_desarme());
            txt_faltafaserearme.setText(""+cfg.getFalta_fase_rearme());
            txt_sobrecargaaviso.setText(""+cfg.getSobrecarga_aviso());
            txt_sobrecargadesarme.setText(""+cfg.getSobrecarga_desarme());
            txt_sobrecargarearme.setText(""+cfg.getSobrecarga_rearme());
            txt_correntenAviso.setText(""+cfg.getCorrente_neutro_aviso());
            txt_correntenDesarme.setText(""+cfg.getCorrente_neutro_desarme());
            txt_correntenRearme.setText(""+cfg.getCorrente_neutro_rearme());
            txt_NreligamentoCorrente.setText(""+ cfg.getNumero_religamentos_corrente());
            txt_intervalo1.setText(""+ cfg.getIntervalo_1());
            txt_intervalo2.setText(""+ cfg.getIntervalo_2());
            txt_intervalo3.setText(""+ cfg.getIntervalo_3());
            txt_intervalo4.setText(""+ cfg.getIntervalo_4());
            txt_intervalo5.setText(""+ cfg.getIntervalo_5());
            txt_TLatenciaReligamento.setText(""+ cfg.getTempo_latencia_pos_religamento());
            txt_TReligamentoNorTens.setText(""+cfg.getTempo_religamento_pos_normalizacao_tensao());
            txt_inrush.setText(""+cfg.getInrush());
            txt_vmax.setText(""+cfg.getVmax());
            txt_limiteSubTensao.setText(""+cfg.getLimite_subtensao());
            txt_limitesobretensao.setText(""+cfg.getLimite_sobre_tensao());
            txt_status.setText(""+ cfg.getInt_status());
            txt_intMed.setText(""+cfg.getInt_med());
            txt_data.setDate(cfg.getDatetime());


        } catch (Exception e2) {

            JOptionPane.showMessageDialog(this, "PRIMEIRO \n NÃO EXISTEM MAIS REGISTROS");
        }
    }

    private void anteriorRegistro() {
        try {

            rs.previous();
            idReligadora = rs.getInt("id_religadora");

            Configuracao cfg = operacao.getConfiguracao(idReligadora);
            System.out.println(idReligadora);
            
           txt_id.setText(""+ cfg.getId());
            txt_idReligadora.setText(""+cfg.getId_religadora());
            txt_opmode.setText(""+cfg.getModo_operacao());
            txt_ka.setText(""+cfg.getKa());
            txt_mca.setText(""+ cfg.getMca());
            txt_icc.setText(""+ cfg.getIcc());
            txt_is.setText(""+ cfg.getIs());
            txt_cserv.setText(""+ cfg.getCserv());
            txt_ccurto.setText(""+cfg.getCcurto());
            txt_cmax.setText(""+cfg.getCmax());
            txt_cneutro.setText(""+cfg.getCneutro());
            txt_cneutromax.setText(""+cfg.getCneutromax());
            txt_ncsc.setText(""+cfg.getNcsc());
            txt_ncsot.setText(""+cfg.getNcsot());
            txt_ncsut.setText(""+cfg.getNcsut());
            txt_ptrafo.setText(""+cfg.getPtrafo());
            txt_lacsoc.setText(""+cfg.getLacsoc());
            txt_lalsoc.setText(""+cfg.getLalsoc());
            txt_pacpot.setText(""+cfg.getPacpot());
            txt_carrenterearme.setText(""+cfg.getCorrente_rearme());
            txt_correnteaviso.setText(""+cfg.getCorrente_aviso());
            txt_correntedesarme.setText(""+cfg.getCorrente_desarme());
            txt_subtensaoaviso.setText(""+cfg.getSub_tensao_aviso());
            txt_subtensaodesarme.setText(""+cfg.getSub_tensao_desarme());
            txt_subtensaorearme.setText(""+cfg.getSub_tensao_rearme());
            txt_sobretensaoaviso.setText(""+cfg.getSobre_tensao_aviso());
            txt_sobretensaodesarme.setText(""+cfg.getSobre_tensao_desarme());
            txt_sobretensaorearme.setText(""+cfg.getSobre_tensao_rearme());
            txt_faltafaseaviso.setText(""+cfg.getFalta_fase_aviso());
            txt_faltafasedesarme.setText(""+cfg.getFalta_fase_desarme());
            txt_faltafaserearme.setText(""+cfg.getFalta_fase_rearme());
            txt_sobrecargaaviso.setText(""+cfg.getSobrecarga_aviso());
            txt_sobrecargadesarme.setText(""+cfg.getSobrecarga_desarme());
            txt_sobrecargarearme.setText(""+cfg.getSobrecarga_rearme());
            txt_correntenAviso.setText(""+cfg.getCorrente_neutro_aviso());
            txt_correntenDesarme.setText(""+cfg.getCorrente_neutro_desarme());
            txt_correntenRearme.setText(""+cfg.getCorrente_neutro_rearme());
            txt_NreligamentoCorrente.setText(""+ cfg.getNumero_religamentos_corrente());
            txt_intervalo1.setText(""+ cfg.getIntervalo_1());
            txt_intervalo2.setText(""+ cfg.getIntervalo_2());
            txt_intervalo3.setText(""+ cfg.getIntervalo_3());
            txt_intervalo4.setText(""+ cfg.getIntervalo_4());
            txt_intervalo5.setText(""+ cfg.getIntervalo_5());
            txt_TLatenciaReligamento.setText(""+ cfg.getTempo_latencia_pos_religamento());
            txt_TReligamentoNorTens.setText(""+cfg.getTempo_religamento_pos_normalizacao_tensao());
            txt_inrush.setText(""+cfg.getInrush());
            txt_vmax.setText(""+cfg.getVmax());
            txt_limiteSubTensao.setText(""+cfg.getLimite_subtensao());
            txt_limitesobretensao.setText(""+cfg.getLimite_sobre_tensao());
            txt_status.setText(""+ cfg.getInt_status());
            txt_intMed.setText(""+cfg.getInt_med());
             txt_data.setDate(cfg.getDatetime());


        } catch (Exception e2) {

            JOptionPane.showMessageDialog(this, "ANTERIOR \n NÃO EXISTEM MAIS REGISTROS");
        }
    }

    private void proximoRegistro() {
        try {

            rs.next();
            idReligadora = rs.getInt("id_religadora");

            Configuracao cfg = operacao.getConfiguracao(idReligadora);
            System.out.println(idReligadora);
           
            txt_id.setText(""+ cfg.getId());
            txt_idReligadora.setText(""+cfg.getId_religadora());
            txt_opmode.setText(""+cfg.getModo_operacao());
            txt_ka.setText(""+cfg.getKa());
            txt_mca.setText(""+ cfg.getMca());
            txt_icc.setText(""+ cfg.getIcc());
            txt_is.setText(""+ cfg.getIs());
            txt_cserv.setText(""+ cfg.getCserv());
            txt_ccurto.setText(""+cfg.getCcurto());
            txt_cmax.setText(""+cfg.getCmax());
            txt_cneutro.setText(""+cfg.getCneutro());
            txt_cneutromax.setText(""+cfg.getCneutromax());
            txt_ncsc.setText(""+cfg.getNcsc());
            txt_ncsot.setText(""+cfg.getNcsot());
            txt_ncsut.setText(""+cfg.getNcsut());
            txt_ptrafo.setText(""+cfg.getPtrafo());
            txt_lacsoc.setText(""+cfg.getLacsoc());
            txt_lalsoc.setText(""+cfg.getLalsoc());
            txt_pacpot.setText(""+cfg.getPacpot());
            txt_carrenterearme.setText(""+cfg.getCorrente_rearme());
            txt_correnteaviso.setText(""+cfg.getCorrente_aviso());
            txt_correntedesarme.setText(""+cfg.getCorrente_desarme());
            txt_subtensaoaviso.setText(""+cfg.getSub_tensao_aviso());
            txt_subtensaodesarme.setText(""+cfg.getSub_tensao_desarme());
            txt_subtensaorearme.setText(""+cfg.getSub_tensao_rearme());
            txt_sobretensaoaviso.setText(""+cfg.getSobre_tensao_aviso());
            txt_sobretensaodesarme.setText(""+cfg.getSobre_tensao_desarme());
            txt_sobretensaorearme.setText(""+cfg.getSobre_tensao_rearme());
            txt_faltafaseaviso.setText(""+cfg.getFalta_fase_aviso());
            txt_faltafasedesarme.setText(""+cfg.getFalta_fase_desarme());
            txt_faltafaserearme.setText(""+cfg.getFalta_fase_rearme());
            txt_sobrecargaaviso.setText(""+cfg.getSobrecarga_aviso());
            txt_sobrecargadesarme.setText(""+cfg.getSobrecarga_desarme());
            txt_sobrecargarearme.setText(""+cfg.getSobrecarga_rearme());
            txt_correntenAviso.setText(""+cfg.getCorrente_neutro_aviso());
            txt_correntenDesarme.setText(""+cfg.getCorrente_neutro_desarme());
            txt_correntenRearme.setText(""+cfg.getCorrente_neutro_rearme());
            txt_NreligamentoCorrente.setText(""+ cfg.getNumero_religamentos_corrente());
            txt_intervalo1.setText(""+ cfg.getIntervalo_1());
            txt_intervalo2.setText(""+ cfg.getIntervalo_2());
            txt_intervalo3.setText(""+ cfg.getIntervalo_3());
            txt_intervalo4.setText(""+ cfg.getIntervalo_4());
            txt_intervalo5.setText(""+ cfg.getIntervalo_5());
            txt_TLatenciaReligamento.setText(""+ cfg.getTempo_latencia_pos_religamento());
            txt_TReligamentoNorTens.setText(""+cfg.getTempo_religamento_pos_normalizacao_tensao());
            txt_inrush.setText(""+cfg.getInrush());
            txt_vmax.setText(""+cfg.getVmax());
            txt_limiteSubTensao.setText(""+cfg.getLimite_subtensao());
            txt_limitesobretensao.setText(""+cfg.getLimite_sobre_tensao());
            txt_status.setText(""+ cfg.getInt_status());
            txt_intMed.setText(""+cfg.getInt_med());
            txt_data.setDate(cfg.getDatetime());


        } catch (Exception e2) {

            JOptionPane.showMessageDialog(this, "PROXIMO \n NÃO EXISTEM MAIS REGISTROS");
        }
    }

    private void ultimoRegistro() {
        try {

            rs.last();
            idReligadora = rs.getInt("id_religadora");

            Configuracao cfg = operacao.getConfiguracao(idReligadora);
            System.out.println(idReligadora);
             
           txt_id.setText(""+ cfg.getId());
            txt_idReligadora.setText(""+cfg.getId_religadora());
            txt_opmode.setText(""+cfg.getModo_operacao());
            txt_ka.setText(""+cfg.getKa());
            txt_mca.setText(""+ cfg.getMca());
            txt_icc.setText(""+ cfg.getIcc());
            txt_is.setText(""+ cfg.getIs());
            txt_cserv.setText(""+ cfg.getCserv());
            txt_ccurto.setText(""+cfg.getCcurto());
            txt_cmax.setText(""+cfg.getCmax());
            txt_cneutro.setText(""+cfg.getCneutro());
            txt_cneutromax.setText(""+cfg.getCneutromax());
            txt_ncsc.setText(""+cfg.getNcsc());
            txt_ncsot.setText(""+cfg.getNcsot());
            txt_ncsut.setText(""+cfg.getNcsut());
            txt_ptrafo.setText(""+cfg.getPtrafo());
            txt_lacsoc.setText(""+cfg.getLacsoc());
            txt_lalsoc.setText(""+cfg.getLalsoc());
            txt_pacpot.setText(""+cfg.getPacpot());
            txt_carrenterearme.setText(""+cfg.getCorrente_rearme());
            txt_correnteaviso.setText(""+cfg.getCorrente_aviso());
            txt_correntedesarme.setText(""+cfg.getCorrente_desarme());
            txt_subtensaoaviso.setText(""+cfg.getSub_tensao_aviso());
            txt_subtensaodesarme.setText(""+cfg.getSub_tensao_desarme());
            txt_subtensaorearme.setText(""+cfg.getSub_tensao_rearme());
            txt_sobretensaoaviso.setText(""+cfg.getSobre_tensao_aviso());
            txt_sobretensaodesarme.setText(""+cfg.getSobre_tensao_desarme());
            txt_sobretensaorearme.setText(""+cfg.getSobre_tensao_rearme());
            txt_faltafaseaviso.setText(""+cfg.getFalta_fase_aviso());
            txt_faltafasedesarme.setText(""+cfg.getFalta_fase_desarme());
            txt_faltafaserearme.setText(""+cfg.getFalta_fase_rearme());
            txt_sobrecargaaviso.setText(""+cfg.getSobrecarga_aviso());
            txt_sobrecargadesarme.setText(""+cfg.getSobrecarga_desarme());
            txt_sobrecargarearme.setText(""+cfg.getSobrecarga_rearme());
            txt_correntenAviso.setText(""+cfg.getCorrente_neutro_aviso());
            txt_correntenDesarme.setText(""+cfg.getCorrente_neutro_desarme());
            txt_correntenRearme.setText(""+cfg.getCorrente_neutro_rearme());
            txt_NreligamentoCorrente.setText(""+ cfg.getNumero_religamentos_corrente());
            txt_intervalo1.setText(""+ cfg.getIntervalo_1());
            txt_intervalo2.setText(""+ cfg.getIntervalo_2());
            txt_intervalo3.setText(""+ cfg.getIntervalo_3());
            txt_intervalo4.setText(""+ cfg.getIntervalo_4());
            txt_intervalo5.setText(""+ cfg.getIntervalo_5());
            txt_TLatenciaReligamento.setText(""+ cfg.getTempo_latencia_pos_religamento());
            txt_TReligamentoNorTens.setText(""+cfg.getTempo_religamento_pos_normalizacao_tensao());
            txt_inrush.setText(""+cfg.getInrush());
            txt_vmax.setText(""+cfg.getVmax());
            txt_limiteSubTensao.setText(""+cfg.getLimite_subtensao());
            txt_limitesobretensao.setText(""+cfg.getLimite_sobre_tensao());
            txt_status.setText(""+ cfg.getInt_status());
            txt_intMed.setText(""+cfg.getInt_med());
            txt_data.setDate(cfg.getDatetime());


        } catch (Exception e2) {

            JOptionPane.showMessageDialog(this, "ULTIMO  \n NÃO EXISTEM MAIS REGISTROS");
        }
    }
    
//     private void ultimoRegistro() {
//        try {
//
//            rs.last();
//            idReligadora = rs.getInt("id_religadora");
//
//            Configuracao cfg = operacao.getConfiguracao(idReligadora);
//            System.out.println(idReligadora);
//            txt_id.setText("" + cfg.getId());
//            txt_idReligadora.setText("" + cfg.getId_religadora());
//            txt_opmode.setText("" + cfg.getModo_operacao());
//            txt_ka.setText(fmt.format( cfg.getKa()));
//            txt_mca.setText(fmt.format(  cfg.getMca()));
//            txt_icc.setText(fmt.format(  cfg.getIcc()));
//            txt_is.setText(fmt.format(  cfg.getIs()));
//            txt_cserv.setText(fmt.format(  cfg.getCserv()));
//            txt_ccurto.setText("" + cfg.getCcurto());
//            txt_cmax.setText("" + cfg.getCmax());
//            txt_cneutro.setText("" + cfg.getCneutro());
//            txt_cneutromax.setText("" + cfg.getCneutromax());
//            txt_ncsc.setText("" + cfg.getNcsc());
//            txt_ncsot.setText("" + cfg.getNcsot());
//            txt_ncsut.setText("" + cfg.getNcsut());
//            txt_ptrafo.setText("" + cfg.getPtrafo());
//            txt_lacsoc.setText("" + cfg.getLacsoc());
//            txt_lalsoc.setText("" + cfg.getLalsoc());
//            txt_pacpot.setText("" + cfg.getPacpot());
//            txt_carrenterearme.setText("" + cfg.getCorrente_rearme());
//            txt_correnteaviso.setText("" + cfg.getCorrente_aviso());
//            txt_correntedesarme.setText("" + cfg.getCorrente_desarme());
//            txt_subtensaoaviso.setText("" + cfg.getSub_tensao_aviso());
//            txt_subtensaodesarme.setText("" + cfg.getSub_tensao_desarme());
//            txt_subtensaorearme.setText("" + cfg.getSub_tensao_rearme());
//            txt_sobretensaoaviso.setText("" + cfg.getSobre_tensao_aviso());
//            txt_sobretensaodesarme.setText("" + cfg.getSobre_tensao_desarme());
//            txt_sobretensaorearme.setText("" + cfg.getSobre_tensao_rearme());
//            txt_faltafaseaviso.setText("" + cfg.getFalta_fase_aviso());
//            txt_faltafasedesarme.setText("" + cfg.getFalta_fase_desarme());
//            txt_faltafaserearme.setText("" + cfg.getFalta_fase_rearme());
//            txt_sobrecargaaviso.setText("" + cfg.getSobrecarga_aviso());
//            txt_sobrecargadesarme.setText("" + cfg.getSobrecarga_desarme());
//            txt_sobrecargarearme.setText("" + cfg.getSobrecarga_rearme());
//            txt_correntenAviso.setText("" + cfg.getCorrente_neutro_aviso());
//            txt_correntenDesarme.setText("" + cfg.getCorrente_neutro_desarme());
//            txt_correntenRearme.setText("" + cfg.getCorrente_neutro_rearme());
//            txt_NreligamentoCorrente.setText("" + cfg.getNumero_religamentos_corrente());
//            txt_intervalo1.setText("" + cfg.getIntervalo_1());
//            txt_intervalo2.setText("" + cfg.getIntervalo_2());
//            txt_intervalo3.setText("" + cfg.getIntervalo_3());
//            txt_intervalo4.setText("" + cfg.getIntervalo_4());
//            txt_intervalo5.setText("" + cfg.getIntervalo_5());
//            txt_TLatenciaReligamento.setText("" + cfg.getTempo_latencia_pos_religamento());
//            txt_TReligamentoNorTens.setText("" + cfg.getTempo_religamento_pos_normalizacao_tensao());
//            txt_inrush.setText("" + cfg.getInrush());
//            txt_vmax.setText("" + cfg.getVmax());
//            txt_limiteSubTensao.setText("" + cfg.getLimite_subtensao());
//            txt_limitesobretensao.setText("" + cfg.getLimite_sobre_tensao());
//            txt_status.setText("" + cfg.getInt_status());
//            txt_intMed.setText("" + cfg.getInt_med());
//            txt_data.setText("" + cfg.getDatetime());
//
//
//        } catch (Exception e2) {
//
//            JOptionPane.showMessageDialog(this, "ULTIMO  \n NÃO EXISTEM MAIS REGISTROS");
//        }
//    }
    public static void desabilitaCampos(){
            txt_id.setEnabled(false); 
            txt_idReligadora.setEnabled(false);  
            txt_opmode.setEnabled(false);  
            txt_ka.setEnabled(false);  
            txt_mca.setEnabled(false); 
            txt_icc.setEnabled(false); 
            txt_is.setEnabled(false);  
            txt_cserv.setEnabled(false);
            txt_ccurto.setEnabled(false);
            txt_cmax.setEnabled(false); 
            txt_cneutro.setEnabled(false); 
            txt_cneutromax.setEnabled(false);
            txt_ncsc.setEnabled(false); 
            txt_ncsot.setEnabled(false); 
            txt_ncsut.setEnabled(false); 
            txt_ptrafo.setEnabled(false); 
            txt_lacsoc.setEnabled(false); 
            txt_lalsoc.setEnabled(false); 
            txt_pacpot.setEnabled(false); 
            txt_carrenterearme.setEnabled(false); 
            txt_correnteaviso.setEnabled(false); 
            txt_correntedesarme.setEnabled(false); 
            txt_subtensaoaviso.setEnabled(false); 
            txt_subtensaodesarme.setEnabled(false); 
            txt_subtensaorearme.setEnabled(false); 
            txt_sobretensaoaviso.setEnabled(false); 
            txt_sobretensaodesarme.setEnabled(false); 
            txt_sobretensaorearme.setEnabled(false); 
            txt_faltafaseaviso.setEnabled(false); 
            txt_faltafasedesarme.setEnabled(false); 
            txt_faltafaserearme.setEnabled(false); 
            txt_sobrecargaaviso.setEnabled(false); 
            txt_sobrecargadesarme.setEnabled(false); 
            txt_sobrecargarearme.setEnabled(false); 
            txt_correntenAviso.setEnabled(false); 
            txt_correntenDesarme.setEnabled(false);
            txt_correntenRearme.setEnabled(false); 
            txt_NreligamentoCorrente.setEnabled(false); 
            txt_intervalo1.setEnabled(false); 
            txt_intervalo2.setEnabled(false); 
            txt_intervalo3.setEnabled(false); 
            txt_intervalo4.setEnabled(false); 
            txt_intervalo5.setEnabled(false); 
            txt_TLatenciaReligamento.setEnabled(false); 
            txt_TReligamentoNorTens.setEnabled(false); 
            txt_inrush.setEnabled(false);
            txt_vmax.setEnabled(false); 
            txt_limiteSubTensao.setEnabled(false); 
            txt_limitesobretensao.setEnabled(false);
            txt_status.setEnabled(false); 
            txt_intMed.setEnabled(false); 
            txt_data.setEnabled(false); 
            
            
    }
    public static void hablitaCampos(){
       			//txt_id.setEnabled(true); 
           // txt_idReligadora.setEnabled(true);  
            txt_opmode.setEnabled(true);  
            txt_ka.setEnabled(true);  
            txt_mca.setEnabled(true); 
            txt_icc.setEnabled(true); 
            txt_is.setEnabled(true);  
            txt_cserv.setEnabled(true);
            txt_ccurto.setEnabled(true);
            txt_cmax.setEnabled(true); 
            txt_cneutro.setEnabled(true); 
            txt_cneutromax.setEnabled(true);
            txt_ncsc.setEnabled(true); 
            txt_ncsot.setEnabled(true); 
            txt_ncsut.setEnabled(true); 
            txt_ptrafo.setEnabled(true); 
            txt_lacsoc.setEnabled(true); 
            txt_lalsoc.setEnabled(true); 
            txt_pacpot.setEnabled(true); 
            txt_carrenterearme.setEnabled(true); 
            txt_correnteaviso.setEnabled(true); 
            txt_correntedesarme.setEnabled(true); 
            txt_subtensaoaviso.setEnabled(true); 
            txt_subtensaodesarme.setEnabled(true); 
            txt_subtensaorearme.setEnabled(true); 
            txt_sobretensaoaviso.setEnabled(true); 
            txt_sobretensaodesarme.setEnabled(true); 
            txt_sobretensaorearme.setEnabled(true); 
            txt_faltafaseaviso.setEnabled(true); 
            txt_faltafasedesarme.setEnabled(true); 
            txt_faltafaserearme.setEnabled(true); 
            txt_sobrecargaaviso.setEnabled(true); 
            txt_sobrecargadesarme.setEnabled(true); 
            txt_sobrecargarearme.setEnabled(true); 
            txt_correntenAviso.setEnabled(true); 
            txt_correntenDesarme.setEnabled(true);
            txt_correntenRearme.setEnabled(true); 
            txt_NreligamentoCorrente.setEnabled(true); 
            txt_intervalo1.setEnabled(true); 
            txt_intervalo2.setEnabled(true); 
            txt_intervalo3.setEnabled(true); 
            txt_intervalo4.setEnabled(true); 
            txt_intervalo5.setEnabled(true); 
            txt_TLatenciaReligamento.setEnabled(true); 
            txt_TReligamentoNorTens.setEnabled(true); 
            txt_inrush.setEnabled(true);
            txt_vmax.setEnabled(true); 
            txt_limiteSubTensao.setEnabled(true); 
            txt_limitesobretensao.setEnabled(true);
            txt_status.setEnabled(true); 
            txt_intMed.setEnabled(true); 
            txt_data.setEnabled(true); 
            
    }
    public boolean verificaCamposNulos(){
        if (txt_opmode.getText().equals("") || txt_opmode.getText() == null) {
            JOptionPane.showMessageDialog(null,"CAMPO opmode EM BRANCO");
            txt_opmode.requestFocus();
           
        }
        if (txt_ka.getText().equals("") || txt_ka.getText() == null) {
        }
        if (txt_mca.getText().equals("") || txt_mca.getText() == null) {
        }
        if (txt_icc.getText().equals("") || txt_icc.getText() == null) {
        }
        if (txt_is.getText().equals("") || txt_is.getText() == null) {
        }
        if (txt_cserv.getText().equals("") || txt_cserv.getText() == null) {
        }
        if (txt_ccurto.getText().equals("") || txt_ccurto.getText() == null) {
        }
        if (txt_cmax.getText().equals("") || txt_cmax.getText() == null) {
        }
        if (txt_cneutro.getText().equals("") || txt_cneutro.getText() == null) {
        }
        if (txt_cneutromax.getText().equals("") || txt_cneutromax.getText() == null) {
        }
        if (txt_ncsc.getText().equals("") || txt_ncsc.getText() == null) {
        }
        if (txt_ncsot.getText().equals("") || txt_ncsot.getText() == null) {
        }
        if (txt_ncsut.getText().equals("") || txt_ncsut.getText() == null) {
        }
        if (txt_ptrafo.getText().equals("") || txt_ptrafo.getText() == null) {
        }
        if (txt_lacsoc.getText().equals("") || txt_lacsoc.getText() == null) {
        }
        if (txt_lalsoc.getText().equals("") || txt_lalsoc.getText() == null) {
        }
        if (txt_pacpot.getText().equals("") || txt_pacpot.getText() == null) {
        }
        if (txt_carrenterearme.getText().equals("") || txt_carrenterearme.getText() == null) {
        }
        if (txt_correnteaviso.getText().equals("") || txt_correnteaviso.getText() == null) {
        }
        if (txt_correntedesarme.getText().equals("") || txt_correntedesarme.getText() == null) {
        }
        if (txt_subtensaoaviso.getText().equals("") || txt_subtensaoaviso.getText() == null) {
        }
        if (txt_subtensaodesarme.getText().equals("") || txt_subtensaodesarme.getText() == null) {
        }
        if (txt_subtensaorearme.getText().equals("") || txt_subtensaorearme.getText() == null) {
        }
        if (txt_sobretensaoaviso.getText().equals("") || txt_sobretensaoaviso.getText() == null) {
        }
        if (txt_sobretensaodesarme.getText().equals("") || txt_sobretensaodesarme.getText() == null) {
        }
        if (txt_sobretensaorearme.getText().equals("") || txt_sobretensaorearme.getText() == null) {
        }
        if (txt_faltafaseaviso.getText().equals("") || txt_faltafaseaviso.getText() == null) {
        }
        if (txt_faltafasedesarme.getText().equals("") || txt_faltafasedesarme.getText() == null) {
        }
        if (txt_faltafaserearme.getText().equals("") || txt_faltafaserearme.getText() == null) {
        }
        if (txt_sobrecargaaviso.getText().equals("") || txt_sobrecargaaviso.getText() == null) {
        }
        if (txt_sobrecargadesarme.getText().equals("") || txt_sobrecargadesarme.getText() == null) {
        }
        if (txt_sobrecargarearme.getText().equals("") || txt_sobrecargarearme.getText() == null) {
        }
        if (txt_correntenAviso.getText().equals("") || txt_correntenAviso.getText() == null) {
        }
        if (txt_correntenDesarme.getText().equals("") || txt_correntenDesarme.getText() == null) {
        }
        if (txt_correntenRearme.getText().equals("") || txt_correntenRearme.getText() == null) {
        }
        if (txt_NreligamentoCorrente.getText().equals("") || txt_NreligamentoCorrente.getText() == null) {
        }
        if (txt_intervalo1.getText().equals("") || txt_intervalo1.getText() == null) {
        }
        if (txt_intervalo2.getText().equals("") || txt_intervalo2.getText() == null) {
        }
        if (txt_intervalo3.getText().equals("") || txt_intervalo3.getText() == null) {
        }
        if (txt_intervalo4.getText().equals("") || txt_intervalo4.getText() == null) {
        }
        if (txt_intervalo5.getText().equals("") || txt_intervalo5.getText() == null) {
        }
        if (txt_TLatenciaReligamento.getText().equals("") || txt_TLatenciaReligamento.getText() == null) {
        }
        if (txt_TReligamentoNorTens.getText().equals("") || txt_TReligamentoNorTens.getText() == null) {
        }
        if (txt_inrush.getText().equals("") || txt_inrush.getText() == null) {
        }
        if (txt_vmax.getText().equals("") || txt_vmax.getText() == null) {
        }
        if (txt_limiteSubTensao.getText().equals("") || txt_limiteSubTensao.getText() == null) {
        }
        if (txt_limitesobretensao.getText().equals("") || txt_limitesobretensao.getText() == null) {
        }
        if (txt_status.getText().equals("") || txt_status.getText() == null) {
        }
        if (txt_intMed.getText().equals("") || txt_intMed.getText() == null) {
        }
        return false;
    }
            
    public void setParametroInteiro(){
        	 txt_opmode.setDocument(new PainelConfiguracao.limitaInteiro()); 
            txt_ka.setDocument(new PainelConfiguracao.limitaInteiro()); 
            txt_mca.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_icc.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_is.setDocument(new PainelConfiguracao.limitaInteiro()); 
            txt_cserv.setEnabled(true);
            txt_ccurto.setEnabled(true);
            txt_cmax.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_cneutro.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_cneutromax.setEnabled(true);
            txt_ncsc.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_ncsot.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_ncsut.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_ptrafo.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_lacsoc.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_lalsoc.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_pacpot.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_carrenterearme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_correnteaviso.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_correntedesarme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_subtensaoaviso.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_subtensaodesarme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_subtensaorearme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_sobretensaoaviso.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_sobretensaodesarme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_sobretensaorearme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_faltafaseaviso.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_faltafasedesarme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_faltafaserearme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_sobrecargaaviso.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_sobrecargadesarme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_sobrecargarearme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_correntenAviso.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_correntenDesarme.setEnabled(true);
            txt_correntenRearme.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_NreligamentoCorrente.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_intervalo1.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_intervalo2.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_intervalo3.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_intervalo4.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_intervalo5.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_TLatenciaReligamento.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_TReligamentoNorTens.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_inrush.setEnabled(true);
            txt_vmax.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_limiteSubTensao.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_limitesobretensao.setEnabled(true);
            txt_status.setDocument(new PainelConfiguracao.limitaInteiro());
            txt_intMed.setDocument(new PainelConfiguracao.limitaInteiro());
    }
    public static class limitaInteiro extends PlainDocument {

        int valor = 6;

        @Override
        public void insertString(int offs, String str, AttributeSet a)
                throws BadLocationException {
            if (str != null && (getLength() + str.length() <= valor)) {
                String sentenca = Normalizer.normalize(str.toUpperCase(), Normalizer.Form.NFD); // elimina os acentos.
                sentenca = sentenca.replaceAll("[^0-9],.", "");

                super.insertString(offs, sentenca, a);
            }
        }
    }
}
